﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ZoomAndPan"
    >
    
    <!--
    Default style and template for the ZoomAndPanControl.
    -->
    <Style 
        TargetType="{x:Type local:ZoomAndPanControl}"
        >
        
        <Setter 
            Property="Template"
            >
            <Setter.Value>
                
                <ControlTemplate 
                    TargetType="{x:Type local:ZoomAndPanControl}"
                    >
                    
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        >
                        
                        <!-- 
                        The ContentPresenter is used to scale and offset the content of ZoomAndPanControl.
                    
                        A transforms computed from 'ContentScale', 'ContentOffsetX' and 'ContentOffsetY' are assigned 
                        to the 'RenderTransform' property in OnApplyTemplate in ZoomAndPanControl.cs.
                        
                        The alignment is set to top-left.  This allows the content offset to be used to place
                        the content in the center of the viewport when the viewport is bigger than the content.
                        -->
                        <ContentPresenter 
							x:Name="PART_Content"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            />
                            
                    </Border>
                    
                </ControlTemplate>
                
            </Setter.Value>
        </Setter>
        
    </Style>

</ResourceDictionary>
